﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using ITOMMS.Entity;
using Watson.Core.Tools;
using System.Text;
namespace ITOMMS.Web.Knowledge
{
    public partial class ArticleListMore : BasePage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                databind();
            }
        }

        private void databind()
        {
            List<VwKnowledgeEntity> tempList = new List<VwKnowledgeEntity>();
            tempList = new VwKnowledgeEntity().GetAllByQuery(" 1=1 and  ClassID='2'", "order by id desc", 8, 1);//硬件区域
            this.GridViewArticle_1.DataSource = tempList;
            this.GridViewArticle_1.DataBind();

            tempList = new List<VwKnowledgeEntity>();
            tempList = new VwKnowledgeEntity().GetAllByQuery(" 1=1 and  ClassID='3'", "order by id desc", 8, 1);//软件区域
            this.GridViewArticle_2.DataSource = tempList;
            this.GridViewArticle_2.DataBind();

            tempList = new List<VwKnowledgeEntity>();
            tempList = new VwKnowledgeEntity().GetAllByQuery(" 1=1 and  ClassID='4'", "order by id desc", 8, 1);//网络区域
            this.GridViewArticle_3.DataSource = tempList;
            this.GridViewArticle_3.DataBind();

            tempList = new List<VwKnowledgeEntity>();
            tempList = new VwKnowledgeEntity().GetAllByQuery(" 1=1 and  ClassID='5'", "order by id desc", 8, 1);//安全区域
            this.GridViewArticle_4.DataSource = tempList;
            this.GridViewArticle_4.DataBind();
        }

        protected void btnMore_ServerClick(object sender, EventArgs e)
        {
            Response.Redirect("~/Knowledge/ArticleList.aspx", true);
        }


        public string GetArticlAuthor(string param)
        {
            string result = "";

            VwUserEntity user = new Entity.VwUserEntity();
            user = user.FindEntity("ID=" + param);
            if (user != null)
            {
                result = user.RealName;
            }
            return result;
        }
    }
}